Quick Introduction to NLSS.jl for Collaborators

Current Features

  1. 32 different algorithms for solving the cubic NLSE
  2. One line to switch between different levels of precision (single, double, quad, etc.)
  3. Support for solving Hirota equation using a combined split-step and finite difference approach
  4. Full support for DT for the cubic NLSE with all 4 seeds
  5. Very heavily optimized numerical solver to improve performance and memory usage
  6. Export data as HDF5 for easy manipulation in any other software or programming language
  7. Easy plotting of data (early stages for now). Very easily modifiable using Plots.jl package.
  8. Calculate and plot integrals of motion (energies, particle number, momentum, their errors)

Planned Features

  1. Suppport for solving the Sasa-Satsuma equation numerically
  2. Support for DT for entire Nonlinear Schrodinger Hierarchy using the lax pair I derived a couple of years ago
  3. Support for Sasa-Satsuma DT (maybe not whole hierarchy, it's difficult to derive it)
  4. Publicatin quality graphics

Using the Nonlinear Schrodinger Suite

After installing everything properly, it is very simple to use the Nonlinear Schrodinger Suite (NLSS.jl). First, we start by "using" the package.

You can ignore the lines below using NLSS.jl, they are to make the plots larger.

Simulations

To run a simple simulation of the NLSE, we start by defining some parameters, we can choose either $a$, $T$, $\Omega$ or $\lambda$ and pass it to the params function which will convert it to the 3 important ones $\lambda, T$ and $\Omega$.

Then we create a simulation box. The first 2 parameters are mandatory, $x_r$ which is the $x$ range of the box and $T$ which is the tepmoral size of the box. $x_r$ is supplied as a pair: e.g. x_r = 0=>10 and the box will run from x = 0 to x = 10. T is supplied as a float and the box will range across the interval $[-T/2, T/2)$.

The remaining parameters are optional and have defaults. For example, you can supply dx (the "time" step in the longitudinal direction, or you can supply $N_x$ directly), $N_t$ (the number of nodes in the transverse (t) direction), n_periods (a multiple for the number of periods), etc.

Then we create the initial wave function. For this example, we will use a simple cosine wave function that we usually use, with coefficients supplied in the array coeff. You can supply as many as you want and A_0 will be automatically created to ensure normalization.

Now we are finally ready to create a simulation Sim object. We supply it with the eigenvalue $\lambda$, the box object created above, as well as the initial condition $\psi_0$. We also need to supply the algorithm as the fourth argument. The available integrators for the NLS are listed below. Note that each algorithm has 2 variants, A & B. A evaluates the nonlinear term first, and B evaluates the kinetic energy term first.

Basic Algorithms:


Triple Jump Symplectic Algorithms

These are the usual symplectic integrators we have been using before. Reference: XXX


Suzuki's Fractal Symplectic Algorithms

These algorithms are symplectic but require a very large number of force evaluations. However, they use very small time steps. Reference: XXX


Multi Product

These algorithms are the multi product Nystrom integrators we have used in the past. Reference: Prof. Chin's paper.


Optimized

These algorithms are optimized to minimize the number of force evaluations and use very specific coefficients. The 8th order uses only 15 force evaluations for example. Reference: XXX

Now we can solve the simulation object

And compute the integrals of motion (Energy, Momentum and Charge [particle number or norm])

Let's plot the results. The flag power in plot_ψ controls whether we plot $|\psi|$ or $|\psi|^2$.

Pruning

Let's create a simulation with 3 periods without pruning

And now with pruning

Hirota Equation (Work In Progress)

To simulate the Hirota equation, you only have to add the parameter α when creating the simulation. There are currently two options for the algorithm, T2A_H, T1A_H!

Initial Condition from DT

We can also use initial conditions from DT as we often need to do. We can use the

Calculations (i.e. DT, work in progress)

This is simple to do and similar to simulations. All 4 seeds are supported by passing the 4th argument "exp" "0" "cn" "dn".